package com.vimhe.easyimport.validate;

import java.util.Objects;

/**
 * 验证错误消息对象
 *
 * @author Vimhe
 */
public class ErrorMessage {

    private String fileName;

    private Integer sheetIndex;

    private Integer rowIndex;

    private String cellIndex;

    private String cellValue;

    private String errorMessage;

    public String getFileName() {
        return fileName;
    }

    public ErrorMessage setFileName(String fileName) {
        this.fileName = fileName;
        return this;
    }

    public Integer getSheetIndex() {
        return sheetIndex;
    }

    public ErrorMessage setSheetIndex(Integer sheetIndex) {
        this.sheetIndex = sheetIndex;
        return this;
    }

    public Integer getRowIndex() {
        return rowIndex;
    }

    public ErrorMessage setRowIndex(Integer rowIndex) {
        this.rowIndex = rowIndex;
        return this;
    }

    public String getCellIndex() {
        return cellIndex;
    }

    public ErrorMessage setCellIndex(String cellIndex) {
        this.cellIndex = cellIndex;
        return this;
    }

    public String getCellValue() {
        return cellValue;
    }

    public ErrorMessage setCellValue(String cellValue) {
        this.cellValue = cellValue;
        return this;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public ErrorMessage setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
        return this;
    }

    @Override
    public int hashCode() {
        return Objects.hash(fileName, sheetIndex, rowIndex, cellIndex, cellValue, errorMessage);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof ErrorMessage)) {
            return false;
        }
        ErrorMessage that = (ErrorMessage) o;
        return Objects.equals(fileName, that.fileName) &&
                Objects.equals(sheetIndex, that.sheetIndex) &&
                Objects.equals(rowIndex, that.rowIndex) &&
                Objects.equals(cellIndex, that.cellIndex) &&
                Objects.equals(cellValue, that.cellValue) &&
                Objects.equals(errorMessage, that.errorMessage);
    }

    @Override
    public String toString() {
        return "ErrorMessage{" +
                "fileName='" + fileName + '\'' +
                ", sheetIndex=" + sheetIndex +
                ", rowIndex=" + rowIndex +
                ", cellIndex='" + cellIndex + '\'' +
                ", cellValue='" + cellValue + '\'' +
                ", errorMessage='" + errorMessage + '\'' +
                '}';
    }

}
